package com.judysen.jsqlweb.models;

import lombok.Data;

import java.util.Map;

/**
 * rest 统一返回的数据，格式，
 * code=0->成功
 * code！=0->失败，失败时可能返回msg，errors
 */
@Data
public class RestResult {
    private Integer code;
    private String msg;
    private Object data;
    private Map<Object, Object> errors;

    public RestResult() {

    }

    public RestResult(Integer code, String msg, Object data, Map<Object, Object> errors) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.errors = errors;
    }
    public RestResult(Integer code,String msg,Object data){
        this(code,msg,data,null);
    }
}
